<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登 录</title>
    <link rel="stylesheet" href="./styles/reset.css">
    <link rel="stylesheet" href="./styles/styles.css">
</head>
<body>
    <div class="kolento">
      <div class="kol-con">
        <div class="login-box">
          <div class="input-box">
            <input type="text" placeholder="请输入用户名" id="user">
          </div>
          <div class="input-box">
            <input type="password" placeholder="请输入密码" id="psd">
          </div>
          <p class="go pointer" id="login">登 录</p>
        </div>
      </div>
    </div>
    <div class="website"><a href="http://www.kolento.cn" target="_blank">关于 Kolento</a></div>
    <div class="pop">
      <p class="msg"></p>
    </div>
   <script>
      window.onload=function(){
        document.getElementById('login').onclick = function() {  
          Login()
        } 


        document.getElementById('psd').onkeyup = function(e) {
          if(e.keyCode == 13){
            Login();
          }
          
        }
      }   
      
      
      function Login(){
        let user = document.getElementById('user');
          let psd = document.getElementById('psd');
          if(user.value===''){
            let userNotice = new Notification('消息提示', {
              body: '请输入用户名'
            })

          }else{
            if(psd.value===''){
              let psdNotice = new Notification('消息提示', {
                body: '请输入密码'
              })
            }else{
              if(psd.value==='kolento'){
                localStorage.setItem('yourName',user.value);
                window.location.href='./chart.html'
              }else{
                let errNotice = new Notification('消息提示', {
                  body: '密码错误'
                })
              }
            }
          }
      }

  





          
    </script>
</body>
</html>
